package com.xinlu.common.game.bo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.xinlu.common.game.dao.ScZjxxDao;
import com.xinlu.common.game.value.ScZjxxVo;
import com.xinlu.derek.common.BaseBo;
import com.xinlu.persistence.ScZjxx;
import com.xinlu.util.tool.DateUtil;

public class ScZjxxBo extends BaseBo {
	
	/*********		Dao注入 Start	***********/
	
	private ScZjxxDao scZjxxDao;

	public void setScZjxxDao(ScZjxxDao scZjxxDao) {
		this.scZjxxDao = scZjxxDao;
	}
	
	/*********		Dao注入 End	***********/
	
	/**
	 * 
	 * Function :		获取三彩中间信息
	 * @param yxms		游戏模式
	 * @return
	 * Derek
	 * 2011-5-31 上午01:41:12
	 */
	public List<ScZjxxVo> getAllScZjxxList(String yxlx){
		
		if ("FSD".equals(yxlx)) {
			
			yxlx = "福彩3D";
		}else if ("PLS".equals(yxlx)) {
			
			yxlx = "排列三";
		}
		
		Date today = DateUtil.getDate(DateUtil.YYYYMMDD, DateUtil.getFormatDate(DateUtil.YYYYMMDD, DateUtil.getCurrentdate()));
		
		List<ScZjxx> list = this.scZjxxDao.getScZjxxList(yxlx, today);
		
		List<ScZjxxVo> voList = null;
		
		if (list != null && list.size() > 0) {
			
			ScZjxx po = null;
			ScZjxxVo vo = null;
			voList = new ArrayList<ScZjxxVo>();
			
			for (int i = 0; i < list.size(); i++) {
				
				po = list.get(i);
				
				vo = new ScZjxxVo();
				
				vo.setKjsj(DateUtil.getFormatDate(DateUtil.YYYY_MM_DD_HH_MI_SS, po.getKjsj()));
				
				vo.setQh(po.getQh());
				
				vo.setKjhm(po.getKjhm1() + " " + po.getKjhm2() + " " + po.getKjhm3());
				
				voList.add(vo);
			}
			
		}
		
		return voList;
	}
}
